<template>
    <div class="cretificate-main">
        <el-form class="batchForm" ref="form" :inline="true" :model="searchdata" label-width="60px">
            <div class="search-item firstsearch">
                <el-form-item label="批次号">
                    <el-input size="small" v-model="searchdata.batchNumber" placeholder="请输入批次号"></el-input>
                </el-form-item>
            </div>
            <div class="search-item">
                <el-form-item label="批次名">
                    <el-input size="small" v-model="searchdata.batchName" placeholder="请输入批次名"></el-input>
                </el-form-item>
            </div>
            <div class="search-item">
                <el-form-item label="创建人">
                    <el-input size="small" v-model="searchdata.createPerson" placeholder="请输入创建人"></el-input>
                </el-form-item>
            </div>
            <!-- <div class="search-item">
                <el-form-item label="网点:">
                  <el-select v-model="searchdata.outlets" placeholder="请选择网点" filterable>
                    <el-option
                      v-for="item in branchoptions"
                      :key="item.deptId"
                      :label="item.deptName"
                      :value="item.deptId"
                    ></el-option>
                  </el-select>
                </el-form-item>
            </div>-->
            <div class="search-item">
                <el-form-item label="创建日期" label-width="80px">
                    <el-date-picker
                            type="date"
                            size="small"
                            placeholder="选择创建日期"
                            :picker-options="timeChange"
                            v-model="searchdata.createTime"
                            @change="searchtime"
                    ></el-date-picker>
                </el-form-item>
            </div>
            <el-form-item>
                <div class="search-item">
                    <el-button type="primary" size="small" @click="searchbtn">搜索</el-button>
                    <el-button type="info" size="small" @click="resetForm('form')">重置</el-button>
                </div>
            </el-form-item>
        </el-form>
        <div class="addAndUpdata clearfix">
            <el-button
                    type="primary"
                    size="small"
                    icon="el-icon-plus"
                    @click="dialogFormVisible = true"
            >新增
            </el-button>
            <!--<el-button-->
                    <!--type="danger"-->
                    <!--icon="el-icon-delete-solid"-->
                    <!--@click="deletebtn"-->
                    <!--:disabled="isdelete"-->
                    <!--size="small"-->
            <!--&gt;删除-->
            <!--</el-button>-->
        </div>
        <el-table
                class="batchListTabeForm"
                ref="multipleTable"
                :data="tableData"
                tooltip-effect="dark"
                style="width: 100%"
                :header-cell-style="getRowClass"
                @selection-change="handleSelectionChange"
                @row-click="rowbtn"
                border
        >
            <!--<el-table-column type="selection" width="55"></el-table-column>-->
            <el-table-column prop="batchNumber" label="批次号" align="center"></el-table-column>
            <el-table-column prop="batchName" label="批次名" align="center"></el-table-column>
            <el-table-column prop="imgPath" label="批次路径" align="center"></el-table-column>
            <el-table-column label="创建日期" prop="createTime" align="center"></el-table-column>
            <el-table-column prop="createPerson" label="创建人" align="center"></el-table-column>
            <!-- <el-table-column prop="outlets" label="网点" show-overflow-tooltip align="center"></el-table-column> -->
            <el-table-column label="操作" width="300" align="center">
                <template slot-scope="scope">
                    <div class="operator-c">
                        <el-link
                                type="primary"
                                icon="el-icon-tickets"
                                @click="batchdo(scope.row.batchNumber)"
                                size="small"
                        >证书管理
                        </el-link>
                        <el-link
                                type="success"
                                icon="el-icon-printer"
                                size="small"
                                @click.stop="scanbtn(scope.row.batchNumber,scope.row.imgPath)"
                        >证书扫描
                        </el-link>
                        <el-link
                                type="danger"
                                icon="el-icon-delete"
                                size="small"
                                @click.stop="befor_deletebtn(scope.row)"
                        >删除
                        </el-link>
                        <!-- <el-link
                        plain
                        type="success"
                        icon="el-icon-s-grid"
                        size="small"
                        @click.stop="allScan(scope.row.batchNumber,scope.row.imgPath)"
                        >扫描多个</el-link>-->
                    </div>
                </template>
            </el-table-column>
        </el-table>
        <el-dialog class="dialogResult" title="扫描结果" :visible.sync="outerVisible" width="1150px">
            <div class="scanres-main">
                <el-row>
                    <el-col :span="24" v-for="(item,index) in savebatcharr" :key="index">
                        <div class="grid-content bg-purple-dark card-list">
                            <el-form label-width="180px" :model="item">
                                <el-form-item label="注册号:">
                                    <el-input v-model="item.regNum"></el-input>
                                </el-form-item>
                                <el-form-item label="国际分类:">
                                    <el-input v-model="item.category"></el-input>
                                </el-form-item>
                                <el-form-item label="核定使用商品_服务项目:">
                                    <el-input v-model="item.service"></el-input>
                                </el-form-item>
                                <el-form-item label="注册人:">
                                    <el-input v-model="item.regper"></el-input>
                                </el-form-item>
                                <el-form-item label="注册人地址:">
                                    <el-input v-model="item.regAdd"></el-input>
                                </el-form-item>
                                <el-form-item label="注册日期:">
                                    <el-input v-model="item.regStartTime"></el-input>
                                </el-form-item>
                                <el-form-item label="有效期至:">
                                    <el-input v-model="item.regEndTime"></el-input>
                                </el-form-item>
                            </el-form>
                        </div>
                    </el-col>
                </el-row>
            </div>
            <div slot="footer" class="dialog-footer">
                <el-checkbox v-model="autoSave">自动保存</el-checkbox>&nbsp;&nbsp;&nbsp;
                <el-button @click.stop="outerVisible = false">取 消</el-button>
                <!--img_url_arr:[],-->
                <!--cur_pdf_index:0,-->
                <!--<el-button type="primary" @click.stop="savebatch(nowbatchnumber,nowbatchpatch)">保存证书</el-button>-->
                <el-button type="primary" @click.stop="savebatch(nowbatchnumber,img_url_arr[cur_pdf_index])">保存证书
                </el-button>
            </div>
        </el-dialog>
        <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage1"
                :page-sizes="[10, 20, 30, 40]"
                layout="total, sizes, prev, pager, next, jumper"
                :total="toal"
        ></el-pagination>
        <el-dialog title="新增批次" :visible.sync="dialogFormVisible">
            <el-form class="addbatchrules" :model="addbatchfrom" :rules="addbatchrules" ref="addbatch">
                <el-form-item label="批次号：" :label-width="formLabelWidth" prop="batchNumber">
                    <el-input
                            v-model="addbatchfrom.batchNumber"
                            autocomplete="off"
                            placeholder="请输入批次号 如：202008040001"
                    ></el-input>
                </el-form-item>

                <el-form-item label="批次名：" :label-width="formLabelWidth" prop="batchName">
                    <el-input v-model="addbatchfrom.batchName" autocomplete="off" placeholder="请输入批次名"></el-input>
                </el-form-item>
                <!-- <el-form-item label="创建人：" :label-width="formLabelWidth" prop="createPerson">
                  <el-input
                    v-model="addbatchfrom.createPerson"
                    autocomplete="off"
                    placeholder="请输入创建批次人的姓名"
                  ></el-input>
                </el-form-item>-->
                <el-form-item label="设置扫描路径：" :label-width="formLabelWidth" prop="imgPath">
                    <el-input placeholder="如：D:\\扫描书" v-model="addbatchfrom.imgPath"></el-input>
                </el-form-item>
                <!-- <el-form-item label="网点：" :label-width="formLabelWidth" prop="outlets">
                  <el-select v-model="addbatchfrom.outlets" placeholder="请选择网点" filterable>
                    <el-option
                      v-for="item in branchoptions"
                      :key="item.deptId"
                      :label="item.deptName"
                      :value="item.deptId"
                    ></el-option>
                  </el-select>
                </el-form-item>-->
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="addbath('addbatch')">确 定</el-button>
            </div>
        </el-dialog>
        <div class="scan-main" v-if="ishowscan">
            <div class="sacn-box">
                <div>
                    <div class="sacnTitle">
                        <i class="el-icon-close close" @click="close"></i>
                        <h1
                                style="display:inline-block;font-size:25px"
                                :class="{colortextdo :colortext}"
                        >{{scantext}}</h1>
                    </div>
                    <el-progress type="circle" :percentage="tage" :width="250" :color="errcolor"></el-progress>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import {mapMutations} from "vuex";
    //import { start, end } from "../../utils/pro";
    import {
        addbatch,
        getbathdata,
        getnet,
        getPagedata,
        getTypedo,
        deletebatch,
        scaveBatch,
    } from "../../api/datastac";
    import axios from "axios";

    // import { YprogressBar } from "../../utils/yprogressbar";
    export default {
        name: "batchList",
        components: {},
        props: {},
        sacnresult: [],
        data() {
            return {
                autoSave: false,
                btachIndex: 0,
                exceptiondo: null,
                ishowscan: false,
                colortext: false,
                isdelete: true,
                errcolor: "",
                isgetdata: false,
                nowbatchnumber: 0,
                nowbatchpatch: "",
                tage: 0,
                scantext: "正在扫描........",
                outerVisible: false,
                branchoptions: [], //网点数据
                basedata: [],
                server_status:true,//服务器状态,可以解析为true,不可解析为false
                dialogFormVisible: false,
                imgarr: [],
                img_url_arr: [],
                cur_pdf_index: 0,
                addbatchfrom: {
                    batchName: "",
                    createPerson: "",
                    batchNumber: "",
                    outlets: "",
                    imgPath: "",
                },
                timeChange: {
                    disabledDate(time) {
                        return (
                            // time.getTime() < Date.now() - 3600 * 1000 * 24 * 183 ||
                            time.getTime() >= Date.now()
                        ); //选择时间范围
                    },
                },
                toal: 0,
                // 证书数组
                batchItem: [],
                excelid: [],
                classId: [],
                addbatchrules: {
                    batchNumber: [
                        {required: true, message: "请输入批次号", trigger: "blur"},
                        // { type: "number", message: "批次号必须为数字值" },
                    ],
                    batchName: [
                        {required: true, message: "请输入批次名", trigger: "blur"},
                    ],
                    // createPerson: [
                    //   { required: true, message: "请输入批次创建人", trigger: "blur" },
                    // ],
                    outlets: [{required: true, message: "请选择网点", trigger: "blur"}],
                    imgPath: [{required: true, message: "请选择网点", trigger: "blur"}],
                },
                formLabelWidth: "120px",
                currentPage1: 1,
                tableData: [],
                timer: null,
                timer1: null,
                // 删除
                deletedata: [],
                deletebachnum: [],
                // 检索查询
                searchdata: {
                    batchNumber: "",
                    batchName: "",
                    createPerson: "",
                    createTime: "",
                    outlets: "",
                    pageNum: 1,
                    pageSize: 10,
                },
                pagedo: {
                    pageNum: 1,
                    pageSize: 10,
                },
                // 统计批次号
                batchsta: [],
                // 证书数据
                savebatcharr: [],
            };
        },
        methods: {
            ...mapMutations([
                "changePageSizeData",
                "changePageNumeData",
                "changePageToal",
                "setoutexcelId",
                "setoutexcelclassId",
                "batchid",
            ]),
            resetForm(formName) {
                this.searchdata.batchNumber = "";
                this.searchdata.batchName = "";
                this.searchdata.createPerson = "";
                this.$refs[formName].resetFields();
                this.searchdata.createTime = "";
            },
            // 证书管理
            batchdo(batchNumber) {
                this.$router.push({
                    path: "certificateList",
                    query: {
                        batchNumber: batchNumber,
                    },
                });
            },
            // 表格第一行显示背景
            getRowClass({row, column, rowIndex, columnIndex}) {
                if (rowIndex == 0) {
                    return "background:#F5F7FA";
                } else {
                    return "";
                }
            },
            // 证书扫描
            async scanbtn(batchNumber, path) {
                this.btachIndex = 0;
                this.server_status=true
                this.nowbatchnumber = batchNumber;
                this.nowbatchpatch = path;
                if (path == null) {
                    this.$message({
                        type: "warning",
                        message: "扫描路径为空",
                    });
                    return;
                }
                await this.$http
                    .post("http://127.0.0.1:57380/scan", {
                        pathname: path,
                    })
                    .then(async (res) => {
                        if (res.data.code) {
                            this.$message({
                                type: "error",
                                message: res.data.msg
                            })
                            return
                        }
                        this.imgarr = res.data.data;
                        this.img_url_arr = res.data.urlArr
                        // res.data.forEach(async item => {
                        //   this.ishowscan = true;
                        //   this.colortext = false;
                        //   this.errcolor = "";
                        //   this.scantext = "正在扫描........";
                        //   this.timer = setInterval(() => {
                        //     this.tage += 1;
                        //   }, 500);
                        //   let pdfItem = [];
                        //   pdfItem.push(item)
                        //   await this.pdftoword(pdfItem, batchNumber);
                        //   this.tage = 0;
                        // })
                        if(res.data.data.length==0){
                            this.$message({
                                type: "error",
                                message: "当前文件目录为空",
                            });
                            return
                        }
                        for (let i = this.btachIndex; i < res.data.data.length; i++) {
                            this.ishowscan = true;
                            this.colortext = false;
                            this.errcolor = "";
                            this.scantext = "正在扫描........";
                            this.timer = setInterval(() => {
                                this.tage += 1;
                            }, 500);
                            let item = [];
                            item.push(res.data.data[i]);
                            await this.pdftoword(item, batchNumber);
                            if(!this.server_status){
                                return
                            }
                            if (this.outerVisible == true) {
                                if (this.btachIndex >= this.imgarr.length) {
                                    break;
                                } else {
                                    this.btachIndex = i + 1;
                                    clearInterval(this.timer);
                                    this.timer = null;
                                    break;
                                }
                            }
                            this.tage = 0;
                        }
                    })
                    .catch((err) => {
                        console.log(err);
                        if (err) {
                            this.$message({
                                type: "error",
                                message: "请开启本机node服务",
                            });
                        }
                    });
            },
            scanRound: async function () {
                for (let i = this.btachIndex; i < this.imgarr.length; i++) {
                    this.ishowscan = true;
                    this.colortext = false;
                    this.errcolor = "";
                    this.scantext = "正在扫描........";
                    // console.log(this.tage )
                    // console.log(this.timer);
                    this.timer = setInterval(() => {
                        this.tage += 1;
                    }, 500);
                    let item = [];
                    item.push(this.imgarr[i]);
                    this.cur_pdf_index = i//当前正在识别的文件索引
                     await this.pdftoword(item, this.nowbatchnumber, i);

                    if (this.outerVisible == true) {
                        if (this.btachIndex >= this.imgarr.length) {
                            break;
                        } else {
                            this.btachIndex = i + 1;
                            clearInterval(this.timer);
                            this.timer = null;
                            break;
                        }
                    }
                }
            },
            // 关闭扫描
            close() {
                this.$confirm("此操作将停止扫描, 是否继续?", "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                })
                    .then(() => {
                        this.tage = 0;
                        this.btachIndex = this.imgarr.length;
                        this.ishowscan = false;
                        clearInterval(this.timer);
                        this.timer = null;
                        // return false
                        // this.outerVisible = false;
                    })
                    .catch((err) => {
                        return err;
                    });
            },
            // pdf识别
            async pdftoword(data, batchNumber) {
                let self = this;
                await this.$http
                    .post("/trademark/base2text/recogonize", {
                        json: data,
                    })
                    .then((res) => {
                        if (res.data.code == 200) {
                            if (res.data.data.length == 0) {
                                this.isgetdata = false;
                                this.outerVisible = false;
                                // this.$message({
                                //   type: "error",
                                //   message: "扫描失败！",
                                // });

                                this.colortext = true;
                                this.errcolor = "#f40";
                                this.scantext = "识别失败,请上传可识别图片";
                                this.tage = 0;
                                clearInterval(this.timer);
                                this.timer = null;
                            } else {
                                if (this.autoSave == true) {
                                    this.isgetdata = true;
                                    this.savebatcharr = [];
                                    // 如果国家批号上面有)则清除掉
                                    res.data.data.forEach((item) => {
                                        let newItem = JSON.parse(item);
                                        if (newItem.category.includes(")")) {
                                            newItem.category = newItem.category.split(")").join("");
                                        }
                                        this.savebatcharr.push(newItem);
                                    });
                                    clearInterval(this.timer);
                                    this.timer = null;
                                    this.savebatch(batchNumber, this.img_url_arr[this.cur_pdf_index]);
                                    this.ishowscan = false;
                                    this.outerVisible = true;
                                    return;
                                }
                                this.tage = 100;
                                this.isgetdata = true;
                                this.savebatcharr = [];
                                // 如果国家批号上面有)则清除掉
                                res.data.data.forEach((item) => {
                                    let newItem = JSON.parse(item);
                                    if (newItem.category.includes(")")) {
                                        newItem.category = newItem.category.split(")").join("");
                                    }
                                    this.savebatcharr.push(newItem);
                                });
                                clearInterval(this.timer);
                                this.timer = null;
                                this.ishowscan = false;
                                this.outerVisible = true;
                            }
                        } else {
//                            this.isgetdata = false;
//                            this.outerVisible = false;
//                            // this.$message({
//                            //   type: "error",
//                            //   message: "扫描失败！",
//                            // });
//                            this.colortext = true;
//                            this.errcolor = "#f40";
//                            this.scantext = res.data.message;
//                            clearInterval(this.timer);
//                            this.timer = null;
                            this.isgetdata = false;
                            this.outerVisible = false;
                             this.$message({
                               type: "error",
                               message: res.data.message,
                             });
                            this.colortext = true;
                            this.errcolor = "#f40";
                            this.scantext = "扫描结束....";
                            this.tage = 0;
                            clearInterval(this.timer);
                            this.timer = null;
                            this.btachIndex=this.imgarr.length//终止扫描循环循环
                            this.server_status=false
                        }
                    });
            },
            // 保存证书
            async savebatch(batchNumber, path) {
                this.innerVisible = true;
                var data = this.savebatcharr[0];
                data.batchNumber = batchNumber;
                data.picnum=path.split("\\").pop()
                scaveBatch(data)
                    .then(async (res) => {
                        if (res.data.code == 200) {
                            this.$message({
                                type: "success",
                                message: "保存成功",
                            });
                            this.tage = 0;
                            clearInterval(this.timer);
                            this.timer = null;
                            this.savebatcharr = [];
                            this.outerVisible = false;
                            //移动文件
                            this.$http.get("http://127.0.0.1:57380/processed", {
                                params: {
                                    do: true,
                                    filepath: path,
                                },
                            });
                        } else {
                            let msg = "";
                            if (res.data.message) {
                                msg = res.data.message;
                            } else {
                                msg = "保存失败";
                            }
                            this.tage = 0;
                            this.$message({
                                type: "error",
                                message: msg,
                            });
                        }
                    })
                    .catch((err) => {
                        console.log(err);
                    });
            },
            // 新增批次
            addbath(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        addbatch(this.addbatchfrom)
                            .then((res) => {
                                if (res.data.code == 200) {
                                    this.$message({
                                        message: "新增成功",
                                        type: "success",
                                    });
                                    this.dialogFormVisible = false;
                                    this.getbathdatado(this.$store.state.pagedata);
                                } else {
                                    this.$message({
                                        //批次名或批次号不能重复
                                        message: res.data.message,
                                        type: "error",
                                    });
                                }
                            })
                            .catch((err) => {
                                return err;
                            });
                    } else {
                        this.$message({
                            type: "error",
                            message: "请输入合法的内容",
                        });

                        return false;
                    }
                });
            },
            // 查询所有批次证书
            getbathdatado(getdata) {
                getbathdata(getdata)
                    .then((res) => {
                        if (res.data.code == 200) {
                            this.toal = res.data.data.total;
                            this.tableData = res.data.data.list;
                            this.tableData.forEach((item, i) => {
                                this.addbatchfrom.imgPath = item.imgPath;
                            });
                        } else {
                            this.tableData = [];
                        }
                    })
                    .catch((err) => {
                        // //console.log(err);
                    });
            },
            // 获取网点
            getnetdo() {
                getnet().then((res) => {
                    if (res.data.code == 200) {
                        this.branchoptions = res.data.data;
                    }
                });
            },
            //每页显示的条数
            handleSizeChange(val) {
                this.changePageSizeData(val);
                this.getbathdatado(this.$store.state.pagedata);
            },
            // 页数切换
            handleCurrentChange(val) {
                this.changePageNumeData(val);
                this.getbathdatado(this.$store.state.pagedata);
            },
            toggleSelection(rows) {
                if (rows) {
                    rows.forEach((row) => {
                        this.$refs.multipleTable.toggleRowSelection(row);
                    });
                } else {
                    this.$refs.multipleTable.clearSelection();
                }
            },
            handleSelectionChange(val) {
                this.deletedata =val;
            },
            // 单击某一行时选中
            rowbtn(val) {
                this.toggleSelection([val]);
            },
            timedispose(time) {
                let date = new Date(time);
                return `${date.getFullYear()}-${this.zero(
                    date.getMonth() + 1
                )}-${this.zero(date.getDate())} ${this.zero(date.getHours())}:${this.zero(
                    date.getMinutes()
                )}:${this.zero(date.getSeconds())}`;
            },
            // 时间补零
            zero(n) {
                return n >= 10 ? n : "0" + n;
            },
            //创建时间处理
            searchtime() {
                this.searchdata.createTime = this.timedispose(this.searchdata.createTime);
            },
            // 搜索
            searchbtn() {
                this.searchdata.createPerson = this.searchdata.createPerson.trim();
                getTypedo(this.searchdata)
                    .then((res) => {
                        if (res.data.code == 200) {
                            this.toal = res.data.data.total;
                            this.tableData = res.data.data.list;
                            this.tableData.filter((item) => {
                                this.excelid.push(item.certId);
                                this.classId.push(item.classId);
                            });
                        } else {
                            this.tableData = [];
                        }
                    })
                    .catch((err) => {
                        return err;
                    });
            },
            // 重置
            batchreset() {
                this.getbathdatado(this.$store.state.pagedata);
            },
            befor_deletebtn(value){
                this.deletedata=[]
                this.deletedata.push(value)
                this.deletebtn()
            },
            // 删除
            deletebtn() {
                this.$confirm("此操作将永久删除, 是否继续?", "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                }).then(() => {
                    this.deletedata.forEach((item) => {
                        this.deletebachnum.push(item.batchNumber);
                    });

                    if (this.deletebachnum.length != 0) {
                        deletebatch(this.deletebachnum)
                            .then((res) => {
                                if (res.data.code == 200) {
                                    this.$message({
                                        type: "success",
                                        message: "删除成功！",
                                    });
                                }else{
                                    this.$message({
                                        type: "error",
                                        message: res.data.message,
                                    });
                                }
                                this.getbathdatado(this.$store.state.pagedata);
                            })
                            .catch((err) => {
                                this.$message({
                                    type: "error",
                                    message: "删除失败！",
                                });
                            });
                    } else {
                        this.$message({
                            type: "warning",
                            message: "你没选择删不了！",
                        });
                    }
                });
            },
        },

        watch: {
            deletedata: function (val) {
                if (val.length != 0) {
                    this.isdelete = false;
                } else {
                    this.isdelete = true;
                }
            },
            tage: async function (val) {
                if (val == 99) {
                    if (!this.isgetdata) {
                        this.$message({
                            type: "error",
                            message: "扫描失败！",
                        });
                        this.outerVisible = false;
                        this.colortext = true;
                        this.errcolor = "#f40";
                        this.scantext = "扫描失败........";
                        await clearInterval(this.timer);
                        this.timer = null;
                    }
                }
            },
            outerVisible: function (val) {
                if (!val) {
                    this.savebatcharr = [];
                    this.tage = 0;
                    this.colortext = false;
                    this.errcolor = "";
                    this.scantext = "正在扫描........";
                    clearInterval(this.timer);
                    this.timer = null;
                    this.scanRound();
                }
            },
        },

        mounted() {
            this.getbathdatado(this.pagedo);
            this.getnetdo();
        },
    };
</script>
<style lang="less" scoped>
    @max1920: ~"(max-width: 1920px)";
    .cretificate-main {
        .batchForm {
            display: flex;
            flex-wrap: wrap;
        }
        .el-table {
            margin-top: 20px;
        }
        .operator-c {
            display: flex;
            justify-content: space-around;
        }
        .search-item {
            .el-form-item {
                .el-input {
                    width: 130px;
                }
            }
        }
        .firstsearch {
            margin: 0;
        }
    }

    .clearfix::after {
        content: "";
        display: block;
        clear: both;
    }

    .addbatchrules .el-form-item {
        margin-top: 20px !important;
    }

    .scan-main {
        background-color: rgba(0, 0, 0, 0.5);
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        // transform: translateY(-50%);
        border: 1px solid #000;
    }

    .sacn-box {
        color: #fff;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .sacnTitle {
        margin-bottom: 20px;
        text-align: center;
    }

    .close {
        color: #fff;
        font-size: 30px;
    }

    .scanres-main {
        .el-input {
            width: 900px;
        }
    }
</style>
<style>
    .el-progress__text {
        color: #fff !important;
    }

    .el-checkbox__inner {
        background-color: rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .el-table::before,
    .el-table--group::after,
    .el-table--border::after {
        background: none;
    }
</style>

